//@ sourceURL=HealthFileForm.js
HealthFileForm = Ext.extend(Ext.Window,
{
    constructor : function(a) {
        Ext.applyIf(this, a);
        this.initUIComponents();
        HealthFileForm.superclass.constructor.call(this, {
            layout : "fit",
            id : this.inputFormName,
            items : yearGridFormPanel,
            modal : true,
            bodyStyle : "padding:2px;",
            buttonAlign : "center",
            buttons : yearGridFormButtons,
            title : "添加",
            iconCls : "menu-flowWait",
            width : 620,
            height : 450
        });
    },
    //初始化数据
    initUIComponents : function() {
        createyeargridform({
            operation:this,
            form:{
                saveUrl: __ctxPath+"/health/saveHealthFile.do",
                items:[
                {
                    id : "healthFile.id",
                    name : "healthFile.id",
                    xtype : "hidden",
                    value : this.id == null ? "": this.id
                }, {
                    name : "healthFile.years",
                    xtype : "hidden",
                    id : "healthFile.years",
                    value : this.years == null ? "" : this.years
                },{
                    layout:"column",
                    bodyStyle:"padding:5px;",
                    items:[{
                        layout:"form",
                        bodyStyle:"padding:5px;",
                        defaultType:"textfield",
                        border:false,
                        columnWidth:0.5,
                        items:[{
                            fieldLabel: '所属机构', 
                            width : 146,
                            name: 'healthFile.institution'
                            
                        }]
                },{
                       layout:"form",
                       bodyStyle:"padding:5px;",
                       defaultType:"textfield",
                       border:false,
                       columnWidth:0.5,
                       items:[{
                       fieldLabel: '员工编号'+'<font color=red>*</font>', 
                       name: 'healthFile.personNo',
                       allowBlank:false,
                       width : 146,
                       blankText:"员工编号不能为空！"
                       
                       }]
                   },{
                       layout:"form",
                       bodyStyle:"padding:5px;",
                       defaultType:"textfield",
                       border:false,
                       columnWidth:0.5,
                       items:[{
                       fieldLabel: '姓名',
                       width : 146,
                       name: 'healthFile.personName'
                       }]
                   },{
                       layout:"form",
                       bodyStyle:"padding:5px;",
                       defaultType:"numberfield",
                       border:false,
                       columnWidth:0.5,
                       items:[{
                       fieldLabel: '年龄', 
                       width : 146,
                       name: 'healthFile.age'
                      
                       }]
                   },{ 
                   layout:"form",
                   border:false,
                   bodyStyle:"padding:5px;",
                   columnWidth:.5,
                   items:[{
                       //下拉选型设置
                           fieldLabel : "性别",
                           hiddenName : "healthFile.sex",
                           xtype : "combo",
                           mode : "local",
                           width : 146 ,
                           editable : false,
                           triggerAction : "all",
                           store : [
                                   [ "1",  "男" ],
                                   [ "2",  "女" ] ]
                           
                   }]
                 },{
                       layout:"form",
                       bodyStyle:"padding:5px;",
                       defaultType:"textfield",
                       border:false,
                       columnWidth:0.5,
                       items:[{
                       fieldLabel: '联系电话',
                       width : 146,
                       name: 'healthFile.telephone'
                      
                       }]
                   },{
                       layout:"form",
                       bodyStyle:"padding:5px;",
                       defaultType:"textfield",
                       border:false,
                       columnWidth:0.5,
                       items:[{
                       fieldLabel: '职务',
                       width : 146,
                       name: 'healthFile.occupation'
                      
                       }]
                   },{
                       layout:"form",
                       bodyStyle:"padding:5px;",
                       defaultType:"textfield",
                       border:false,
                       columnWidth:0.5,
                       items:[{
                       fieldLabel: '部门',
                       width : 146,
                       name: 'healthFile.department'
                      
                       }]
                   },{
                       layout:"form",
                       bodyStyle:"padding:5px;",
                       defaultType:"textfield",
                       border:false,
                       columnWidth:0.5,
                       items:[{
                       fieldLabel: '工种',
                       width : 146,
                       name: 'healthFile.workType'
                      
                       }]
                   },{
                       layout:"form",
                       bodyStyle:"padding:5px;",
                       defaultType:"textfield",
                       border:false,
                       columnWidth:0.5,
                       items:[{
                       fieldLabel: '岗位',
                       width : 146,
                       name: 'healthFile.post'
                      
                       }]
                   },{
                       layout:"form",
                       bodyStyle:"padding:5px;",
                       defaultType:"textfield",
                       border:false,
                       columnWidth:0.5,
                       items:[{
                       fieldLabel: '涉及危害因素', 
                       width : 146,
                       name: 'healthFile.factorName'
                      
                       }]
                   }  ]
                },{
                   xtype : 'fieldset',
                   title : '扩展属性',
                   collapsible : true,
                   layout : "column",
                   bodyStyle : "padding:5px;",
                   items : [{
                       layout:"form",
                     //  bodyStyle:"padding:5px;",
                       columnWidth:1.,
                       border:false,
                       items:[{
                       xtype:"textarea",
                       fieldLabel: '职业史', 
                       name: 'healthFile.occupationHistory', 
                       width : 448 
                       }]
                   },{
                       layout:"form",
                    //   bodyStyle:"padding:5px;",
                       columnWidth:1.,
                       border:false,
                       items:[{
                       xtype:"textarea",
                       fieldLabel: '职业病描述', 
                       name: 'healthFile.diseasesDescribe', 
                       width : 448 
                       }]
                   },{
                       layout:"form",
                   //    bodyStyle:"padding:5px;",
                       columnWidth:1.,
                       border:false,
                       items:[{
                       xtype:"textarea",
                       fieldLabel: '职业危害接触史', 
                       name: 'healthFile.harmContact', 
                       width : 448 
                       }]
                   },{
                       layout:"form",
                   //    bodyStyle:"padding:5px;",
                       columnWidth:1.,
                       border:false,
                       items:[{
                       xtype:"textarea", 
                       fieldLabel: '备注', 
                       name: 'healthFile.remark',
                       width : 448 
                       
                       }]
                   }]
                   }
                 
               ]
            },
            loadData:{
                getUrl:__ctxPath +"/health/getHealthFile.do",
                preName : "healthFile"
            },
            isShow:this.isShow
        });
    }
});
